home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_class_spatter.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  71 lines

  1. # Jones 3D Cog Script
  2. #
  3. # class_Spatter.cog
  4. #
  5. # Animates & stretches fall foam sprite...
  6. #
  7. # [RT]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ===================================================================
  11.  
  12. symbols
  13.     
  14.     message        sighted
  15.     message        pulse
  16.  
  17.     material    mat=gen_a1_foamfall_spatter.mat    local
  18.  
  19.     thing        foam                            local
  20.  
  21.     flex        animTime=0.25                    local
  22.     flex        foamState                        local
  23.     flex        fps=15.0                        local
  24.  
  25.     vector        startSize                        local
  26.     vector        endSize                            local
  27.  
  28. end
  29.  
  30. # ===================================================================
  31.  
  32. code
  33.  
  34. sighted:
  35.  
  36.     startSize = VectorSet(0.23, 0.23, 1.0);
  37.     endSize = VectorSet(0.38, 0.38, 1.0);
  38.  
  39.     foam = GetSenderRef();
  40.  
  41.     AnimateSpriteSize(foam, startSize, endSize, animTime);
  42.     SetThingUserData(foam, 1);
  43.     SetThingPulse(foam, animTime);
  44.  
  45.     MaterialAnim(mat, 12, 0x1);
  46.  
  47.     return;
  48.  
  49. # -------------------------------------------------------------------
  50.  
  51. pulse:
  52.  
  53.     foam = GetSenderRef();
  54.     foamState = GetThingUserData(foam);
  55.  
  56.     if (foamState == 0)
  57.     {
  58.         AnimateSpriteSize(foam, endSize, startSize, animTime);
  59.     }
  60.     else
  61.     {
  62.         AnimateSpriteSize(foam, startSize, endSize, animTime);
  63.     }
  64.  
  65.     foamState = 1 - foamState;
  66.  
  67.     return;
  68.  
  69. end
  70.  
  71.